If there is a single connection for a given NMToggle subclass,
use the connection name; otherwise, transform that into '%d
connected'. This is better than the current "Device (counter)"
template, e.g. "VPN (2)", which would give us a quick toggle
with:
VPN
VPN (2)
Change that to e.g.:
VPN
2 connected
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2619>
// transform function for property binding:
// Ignore the provided label if there are multiple active
- // items, and replace it with something like "VPN (2)"
+ // items, and replace it with something like "2 connected"
_transformSubtitle(source) {
const nActive = this.checked
? [...this._getActiveItems()].length
: 0;
if (nActive > 1)
- return `${this._getDefaultName()} (${nActive})`;
+ return ngettext('%d connected', '%d connected', nActive).format(nActive);
return source;
}